import 'package:flutter/material.dart';


class BasicDemo extends StatelessWidget{

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return ContrailDemo();
  }
}




// Container容器，BoxDecoration 装饰盒子 加 边框 ，圆角，阴影，形状，渐变

class ContrailDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
//      color: Colors.grey[100],
      decoration: BoxDecoration(
          image: DecorationImage(
            image: NetworkImage('https://img01.sogoucdn.com/app/a/100520021/ecda2b49a66467c5e9e0016145a00b56'),
            alignment: Alignment.topCenter,
            fit: BoxFit.cover,
//          colorFilter: ColorFilter.mode(Colors.indigoAccent[400], blendMode)
          )
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Container(
            child: Icon(Icons.pool,size: 32.0,color: Colors.white,),
//            color: Color.fromRGBO(3, 54, 255, 1),
            padding: EdgeInsets.all(16.0),
            margin: EdgeInsets.all(8.0),
            width: 90.0,
            height: 90.0,
            //BoxDecoration 装饰盒子 加 边框 ，圆角，阴影，形状，渐变
            decoration: BoxDecoration(
                color: Color.fromRGBO(3, 54, 255, 1),
                border: Border(
                    top: BorderSide(
                      color: Colors.indigoAccent,
                      width: 3.0,
                      style: BorderStyle.solid,
                    )
                ),
//              borderRadius: BorderRadius.circular(45.0)
//              borderRadius: BorderRadius.only(
//                topLeft: Radius.circular(45.0),
//              ),
                boxShadow: [
                  BoxShadow(
                    offset: Offset(6.0, 7.0),
                    color: Color.fromRGBO(16, 20, 188, 1.0),
                    blurRadius: 1.0,
                    spreadRadius: -3.0,
                  )
                ],
                shape: BoxShape.circle,
                gradient: RadialGradient(
                    colors: [
                      Colors.red,
                      Colors.yellow,
                      Colors.black45
                    ]
                )
            ),
          )
        ],
      ),
    );
  }
}




//RichText ：行内多样式的文字
class RichTextDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return RichText(
      text: TextSpan(
          text: '王松锋',
          style: TextStyle(
            color: Colors.deepOrangeAccent,
            fontSize: 30.0,
            fontStyle: FontStyle.italic,
            fontWeight: FontWeight.w200,
          ),
          children: [
            TextSpan(
                text: '呵呵',
                style: TextStyle(
                  fontSize: 10.0,
                  color: Colors.grey,
                )
            )
          ]
      ),
    );
  }
}




//Text 的使用 文字与文字样式
class TextDemo extends StatelessWidget {

  final TextStyle _textStyle = TextStyle(
    fontSize: 16.0,
  );

  final String _author = '李白';
  final String _title = '将进酒';

  @override
  Widget build(BuildContext context) {
    return Text(
      '《$_title》 -- $_author对于女人来说，这话无疑是非常有安全感的。但是对于男人来说，这句话并不是那么容易说出口。'
          '因为这不仅代表了一个承诺，更是表达了他想一直都陪伴在你身边的愿望。'
          '只要你有需要，只要你一开口，他就会随时在为你等待着。如果你不需要他，他就会安静的守护着你。',
      textAlign: TextAlign.left,
      style: _textStyle,
      maxLines: 3,
      overflow: TextOverflow.ellipsis,
    );
  }
}
